cmake_minimum_required(VERSION 3.9)
project(onnx2ncnn)

set(CMAKE_CXX_STANDARD 11)

find_package(OpenMP REQUIRED)
if (OPENMP_FOUND)
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()

set(PROTOBUF_INCLUDE /usr/local/include)
set(PROTOBUF_LIB /usr/local/lib)
set(NCNN_INCLUDE ${CMAKE_SOURCE_DIR}/ncnn_20180314/include)
set(NCNN_LIB ${CMAKE_SOURCE_DIR}/ncnn_20180314//lib)

include_directories(${PROTOBUF_INCLUDE} ${NCNN_INCLUDE})
link_directories(${PROTOBUF_LIB} ${NCNN_LIB})

add_executable(compare main.cpp float_tensor.pb.cc)
target_link_libraries(compare protobuf protobuf-lite protoc ncnn)